Welcome to the Airquality package. This package uses various data from the OpenWeatherMap API and helps you to get on overview about the current airquality data in Europe or any town worldwide.
WHO Statement about Airquality:
Air pollution is contamination of the indoor or outdoor environment by any chemical, physical or biological agent that modifies the natural characteristics of the atmosphere.
Household combustion devices, motor vehicles, industrial facilities and forest fires are common sources of air pollution. Pollutants of major public health concern include particulate matter, carbon monoxide, ozone, nitrogen dioxide and sulfur dioxide. Outdoor and indoor air pollution cause respiratory and other diseases and are important sources of morbidity and mortality.
WHO data show that almost all of the global population (99%) breathe air that exceeds WHO guideline limits and contains high levels of pollutants, with low- and middle-income countries suffering from the highest exposures.
Air quality is closely linked to the earth’s climate and ecosystems globally. Many of the drivers of air pollution (i.e. combustion of fossil fuels) are also sources of greenhouse gas emissions. Policies to reduce air pollution, therefore, offer a win-win strategy for both climate and health, lowering the burden of disease attributable to air pollution, as well as contributing to the near- and long-term mitigation of climate change.
This package can:
In the following, each function is explained in detail and examples are provided.
#github_install can only be added when the week 3 branch is merged
#install_github('Programming-The-Next-Step-2022/airquality')
This function takes the city and country (use ISO 3166 country codes) of interest as arguments. It outputs a data frame containing the:
current_aq_df("Amsterdam", "NL")
## Component Index / Concentration in μg/m3
## 1 AQI 2.00
## 2 CO 198.60
## 3 NO 1.06
## 4 NO2 7.71
## 5 O3 105.86
## 6 SO2 1.55
## 7 PM2_5 2.84
## 8 PM_10 4.23
## 9 NH3 1.93
To display the output to users in a nicer way, you can use the gt::gt() function
gt(current_aq_df())
| Component | Index / Concentration in μg/m3 |
|---|---|
| AQI | 2.00 |
| CO | 198.60 |
| NO | 1.06 |
| NO2 | 7.71 |
| O3 | 105.86 |
| SO2 | 1.55 |
| PM2_5 | 2.84 |
| PM_10 | 4.23 |
| NH3 | 1.93 |
This function takes the city and country (use ISO 3166 country codes) of interest as arguments. It outputs a plot showing the average AQI per day over the last two weeks.
plot_aqi_hist("Paris", "FRA")
This function takes the city, the country (use ISO 3166 country codes), and the desired subcomponent (e.g., co) as arguments. It outputs a plot showing the average concentration of for example carbon monoxide over the last two weeks.
plot_comp_hist("Rome", "ITA", "co")
This function shows the current AQI in the ten largest European cities. The values are colored according the AQI.
current_aq_table()
| Current Airquality Index (AQI) of Top 10 Major Europan Cities | |
|---|---|
| Cities | AQI |
| Istanbul | 2 |
| London | 3 |
| Berlin | 2 |
| Madrid | 2 |
| Kyiv | 1 |
| Rome | 2 |
| Bucharest | 2 |
| Paris | 2 |
| Vienna | 2 |
| Hamburg | 2 |
This function takes the city and country (use ISO 3166 country codes) of interest as arguments. It outputs a data frame containing the:
current_weather("Berlin", "GER")
| Component | Data |
|---|---|
| Current Weather | clear sky |
| Current Temperature | 19.7 |
| Feels Like Temperature | 18.87 |
| Min Temperature | 18.32 |
| Max Temperature | 21.14 |
| Air Pressure | 1010 |
| Humidity | 44 |
| Visibility | 10000 |
| Wind Speed | 5.14 |
| Wind Direction | 280 |